  # the minimum version of CMake.
cmake_minimum_required(VERSION 3.4.1)
project(CameraSample)

set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
add_definitions(-DOHOS_PLATFORM) #must add this

include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include)

add_library(nativerender SHARED
    main.cpp
    camera_manager.cpp
    render/egl_render_context.cpp
    render/render_thread.cpp
    render/plugin_render.cpp
    render/shader_program.cpp
    manager/plugin_manager.cpp
)


find_library(
    # Sets the name of the path variable.
    native-drawing-lib
    # Specifies the name of the NDK library that
    # you want CMake to locate.
    native_drawing
)

find_library(
    # Sets the name of the path variable.
    native-window-lib
    # Specifies the name of the NDK library that
    # you want CMake to locate.
    native_window
)

find_library(
    # Sets the name of the path variable.
    hilog-lib
    # Specifies the name of the NDK library that
    # you want CMake to locate.
    hilog_ndk.z
)

find_library(
    # Sets the name of the path variable.
    libace-lib
    # Specifies the name of the NDK library that
    # you want CMake to locate.
    ace_ndk.z
)

find_library(
    # Sets the name of the path variable.
    libnapi-lib
    # Specifies the name of the NDK library that
    # you want CMake to locate.
    ace_napi.z
)

target_link_libraries(nativerender PUBLIC libohcamera.so libace_napi.z.so libnative_buffer.so libhilog_ndk.z.so librawfile.z.so libnative_vsync.so
${native-drawing-lib} ${native-window-lib} ${hilog-lib} ${libace-lib} ${libnapi-lib} libEGL.so
                                                                                     libGLESv3.so
                                                                                     libnative_image.so
                                                                                     libnative_window.so
                                                                                     libnative_buffer.so
                                                                                     libohcamera.so
)
